<?php


class UploadDataColumn extends CDataColumn
{
	
	public $name;
	public $value;
	public $limit=20;
	
	protected function renderDataCellContent($row,$data)
	{
		if (!empty($data["message"]))
		{
			if (mb_strlen($data["message"]) > $this->limit)
			{
				echo CHtml::link(Display::truncateText($data["message"],$this->limit), Yii::app()->createAbsoluteUrl("file/default/view", array("id"=>$data["id"])), array("target"=>"_blank", "class"=>"fancybox"));
			}
			else
				echo $data["message"];
		}
		else
			echo CHtml::link($data["filename"], Yii::app()->createAbsoluteUrl("/download")."/".$data["recipientId"]."/".$data["filename"]);
		
	}
}
